home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13609 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news1.interserv.net!news
  2. From: Jerry Houston <jhouston@Salsa.WallData.com>
  3. Newsgroups: comp.object,comp.lang.eiffel,comp.lang.c++,comp.lang.beta,comp.lang.java,comp.lang.sather
  4. Subject: Re: What Should An Exception Handling Do? -- Clarification of rules
  5. Date: Tue, 26 Mar 1996 10:19:52 -0800
  6. Organization: Wall Data - Salsa Products Division
  7. Message-ID: <31583548.4BEF@Salsa.WallData.com>
  8. References: <1996Mar14.155641.4299@schbbs.mot.com> <4irn11$7ln@mimas.brunel.ac.uk> <Pine.Sola.3.91.960322041345.17711C-100000@ux5.cso.uiuc.edu>
  9. NNTP-Posting-Host: 89184.walldata.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  14.  
  15. Matthew Travis wrote:
  16.  
  17. [snip]
  18.  
  19. > handler is the place to do cleanup and ensure a graceful exit. If the
  20. > exception is something that is recoverable, such as a user entering 5/0 in a
  21. > calculator program, then you should take care of that before an exception
  22. > is thrown. Exceptions should only be thrown for unhandle-able conditions...
  23.  
  24. That's great in theory, but many of us regularly use class libraries 
  25. written by others, for which we cannot or prefer not to modifiy the 
  26. sources.  Code in a catch{} block that recognizes that the user has 
  27. fixed what was wrong, and which subsequently attempts the try{} block 
  28. another time can be very useful, straightforward, and easy to read.
  29.